package com.wells.user.utils;

import com.wells.user.enums.ResultEnum;
import com.wells.user.vo.ResultVo;

/**
 * @Auther: 施永泉
 * @Date: 18/7/27 17:39
 * @Description:
 */
public class ResultVoUtil {

    public static ResultVo success(Object object){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(0);
        resultVo.setMessage("成功");
        resultVo.setData(object);
        return resultVo;
    }

    public static ResultVo success(){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(0);
        resultVo.setMessage("成功");
        return resultVo;
    }

    public static ResultVo error(ResultEnum resultEnum){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(1);
        resultVo.setMessage(resultEnum.getMessage());
        return resultVo;
    }
}
